﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RecursosHumanos
{
    public partial class ProgressWindow : Form
    {
        public int RecordsToProcess { get; private set; }
        public int RecordsProcessed { get; private set; }

        public ProgressWindow(int RecordsToProcess)
        {
            this.RecordsToProcess = RecordsToProcess;
            InitializeComponent();
        }

        public void AddProcesseds()
        {
            RecordsProcessed++;
            AtualizaProgressBar();
        }

        private void AtualizaProgressBar()
        {
            progressBar1.Value = (RecordsProcessed/RecordsToProcess*100);
            lblPorcentagem.Text = progressBar1.Value.ToString() + "%";
            if (progressBar1.Value >= 100)
            {
                this.Close();
            }
        }
    }
}
